package com.zhudeshuai.zhudemolist.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

/**
 * @author zhudeshuai
 * @since 16/6/16
 */
public class MyView extends View {

    public MyView(Context context) {
        super(context);
    }

    public MyView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int measureWidth = 0;
        int measureHeight = 0;

        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);

        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        int heightSize = MeasureSpec.getSize(heightMeasureSpec);

        if (widthMode == MeasureSpec.AT_MOST) {

        } else {
            measureWidth = widthSize;
        }


        setMeasuredDimension(measureWidth, measureHeight);
    }
}
